package com.fc.mall.kdniao.constants;

public enum Shipper {
    SF("SF","顺丰"),
    HTKY("HTKY", "百世快递"),
    ZTO("ZTO", "中通快递"),
    STO("STO", "申通快递"),
    YTO("YTO", "圆通快递"),
    YD("YD", "韵达"),
    YZPY("YZPY", "邮政快递包裹"),
    EMS("EMS", "EMS"),
    HHTT("HHTT", "天天快递"),
    UC("UC", "优速快递"),
    DBL("DBL", "德邦快递"),
    ZJS("ZJS", "宅急送");


    Shipper(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getCode(String desc) {
        Shipper[] shippers = Shipper.values();
        for (Shipper shipper:shippers) {
            if (shipper.getDesc().equals(desc)) {
                return shipper.getCode();
            }
        }
        return null;
    }
}
